home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / Memory.h < prev    next >
Text File  |  1995-07-06  |  18KB  |  664 lines

  1. /*
  2.      File:        Memory.h
  3.  
  4.      Contains:    Memory Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __MEMORY__
  21. #define __MEMORY__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MIXEDMODE__
  30. #include <MixedMode.h>
  31. #endif
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_ALIGN_SUPPORTED
  38. #pragma options align=mac68k
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45.  
  46. enum {
  47.     maxSize                        = 0x800000,                        /*Max data block size is 8 megabytes*/
  48.     defaultPhysicalEntryCount    = 8,
  49. /* values returned from the GetPageState function */
  50.     kPageInMemory                = 0,
  51.     kPageOnDisk                    = 1,
  52.     kNotPaged                    = 2
  53. };
  54.  
  55. enum {
  56. /* masks for Zone->heapType field */
  57.     k32BitHeap                    = 1,                            /* valid in all Memory Managers */
  58.     kNewStyleHeap                = 2,                            /* true if new Heap Manager is present */
  59.     kNewDebugHeap                = 4                                /* true if new Heap Manager is running in debug mode on this heap */
  60. };
  61.  
  62. /* size of a block in bytes */
  63. typedef long Size;
  64.  
  65. typedef pascal long (*GrowZoneProcPtr)(Size cbNeeded);
  66. typedef pascal void (*PurgeProcPtr)(Handle blockToPurge);
  67. /*
  68.         UserFnProcPtr uses register based parameters on the 68k and cannot
  69.         be written in or called from a high-level language without the help of
  70.         mixed mode or assembly glue.
  71.  
  72.             typedef pascal void (*UserFnProcPtr)(void *parameter);
  73.  
  74.         In:
  75.          => *parameter      A0.L
  76. */
  77.  
  78. #if GENERATINGCFM
  79. typedef UniversalProcPtr GrowZoneUPP;
  80. typedef UniversalProcPtr PurgeUPP;
  81. typedef UniversalProcPtr UserFnUPP;
  82. #else
  83. typedef GrowZoneProcPtr GrowZoneUPP;
  84. typedef PurgeProcPtr PurgeUPP;
  85. typedef Register68kProcPtr UserFnUPP;
  86. #endif
  87.  
  88. typedef struct Zone Zone, *THz;
  89.  
  90. struct Zone {
  91.     Ptr                                bkLim;
  92.     Ptr                                purgePtr;
  93.     Ptr                                hFstFree;
  94.     long                            zcbFree;
  95.     GrowZoneUPP                        gzProc;
  96.     short                            moreMast;
  97.     short                            flags;
  98.     short                            cntRel;
  99.     short                            maxRel;
  100.     short                            cntNRel;
  101.     Byte                            heapType;
  102.     Byte                            unused;
  103.     short                            cntEmpty;
  104.     short                            cntHandles;
  105.     long                            minCBFree;
  106.     PurgeUPP                        purgeProc;
  107.     Ptr                                sparePtr;
  108.     Ptr                                allocPtr;
  109.     short                            heapData;
  110. };
  111. struct MemoryBlock {
  112.     void                            *address;
  113.     unsigned long                    count;
  114. };
  115. typedef struct MemoryBlock MemoryBlock;
  116.  
  117. struct LogicalToPhysicalTable {
  118.     MemoryBlock                        logical;
  119.     MemoryBlock                        physical[defaultPhysicalEntryCount];
  120. };
  121. typedef struct LogicalToPhysicalTable LogicalToPhysicalTable;
  122.  
  123. typedef short PageState;
  124.  
  125. typedef short StatusRegisterContents;
  126.  
  127. enum {
  128.     uppGrowZoneProcInfo = kPascalStackBased
  129.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  130.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Size))),
  131.     uppPurgeProcInfo = kPascalStackBased
  132.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle))),
  133.     uppUserFnProcInfo = kRegisterBased
  134.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(void*)))
  135. };
  136.  
  137. #if GENERATINGCFM
  138. #define NewGrowZoneProc(userRoutine)        \
  139.         (GrowZoneUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
  140. #define NewPurgeProc(userRoutine)        \
  141.         (PurgeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture())
  142. #define NewUserFnProc(userRoutine)        \
  143.         (UserFnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture())
  144. #else
  145. #define NewGrowZoneProc(userRoutine)        \
  146.         ((GrowZoneUPP) (userRoutine))
  147. #define NewPurgeProc(userRoutine)        \
  148.         ((PurgeUPP) (userRoutine))
  149. #define NewUserFnProc(userRoutine)        \
  150.         ((UserFnUPP) (userRoutine))
  151. #endif
  152.  
  153. #if GENERATINGCFM
  154. #define CallGrowZoneProc(userRoutine, cbNeeded)        \
  155.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppGrowZoneProcInfo, (cbNeeded))
  156. #define CallPurgeProc(userRoutine, blockToPurge)        \
  157.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppPurgeProcInfo, (blockToPurge))
  158. #define CallUserFnProc(userRoutine, parameter)        \
  159.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppUserFnProcInfo, (parameter))
  160. #else
  161. #define CallGrowZoneProc(userRoutine, cbNeeded)        \
  162.         (*(userRoutine))((cbNeeded))
  163. #define CallPurgeProc(userRoutine, blockToPurge)        \
  164.         (*(userRoutine))((blockToPurge))
  165. /* (*UserFnProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  166. #endif
  167.  
  168. extern pascal Ptr GetApplLimit( void )
  169.     TWOWORDINLINE( 0x2EB8, 0x0130 ); /* MOVE.l $0130,(SP) */
  170. extern pascal THz SystemZone( void )
  171.     TWOWORDINLINE( 0x2EB8, 0x02A6 ); /* MOVE.l $02A6,(SP) */
  172. extern pascal THz ApplicationZone( void )
  173.     TWOWORDINLINE( 0x2EB8, 0x02AA ); /* MOVE.l $02AA,(SP) */
  174. extern pascal Handle GZSaveHnd( void )
  175.     TWOWORDINLINE( 0x2EB8, 0x0328 ); /* MOVE.l $0328,(SP) */
  176. extern pascal Ptr TopMem( void )
  177.     TWOWORDINLINE( 0x2EB8, 0x0108 ); /* MOVE.l $0108,(SP) */
  178. extern pascal OSErr MemError( void )
  179.     TWOWORDINLINE( 0x3EB8, 0x0220 ); /* MOVE.w $0220,(SP) */
  180.  
  181. #if !GENERATINGCFM
  182. #pragma parameter __A0 GetZone
  183. #endif
  184. extern pascal THz GetZone(void)
  185.  ONEWORDINLINE(0xA11A);
  186.  
  187. #if !GENERATINGCFM
  188. #pragma parameter __A0 NewHandle(__D0)
  189. #endif
  190. extern pascal Handle NewHandle(Size byteCount)
  191.  ONEWORDINLINE(0xA122);
  192.  
  193. #if !GENERATINGCFM
  194. #pragma parameter __A0 NewHandleSys(__D0)
  195. #endif
  196. extern pascal Handle NewHandleSys(Size byteCount)
  197.  ONEWORDINLINE(0xA522);
  198.  
  199. #if !GENERATINGCFM
  200. #pragma parameter __A0 NewHandleClear(__D0)
  201. #endif
  202. extern pascal Handle NewHandleClear(Size byteCount)
  203.  ONEWORDINLINE(0xA322);
  204.  
  205. #if !GENERATINGCFM
  206. #pragma parameter __A0 NewHandleSysClear(__D0)
  207. #endif
  208. extern pascal Handle NewHandleSysClear(Size byteCount)
  209.  ONEWORDINLINE(0xA722);
  210.  
  211. #if !GENERATINGCFM
  212. #pragma parameter __A0 HandleZone(__A0)
  213. #endif
  214. extern pascal THz HandleZone(Handle h)
  215.  ONEWORDINLINE(0xA126);
  216.  
  217. #if !GENERATINGCFM
  218. #pragma parameter __A0 RecoverHandle(__A0)
  219. #endif
  220. extern pascal Handle RecoverHandle(Ptr p)
  221.  ONEWORDINLINE(0xA128);
  222.  
  223. #if !GENERATINGCFM
  224. #pragma parameter __A0 RecoverHandleSys(__A0)
  225. #endif
  226. extern pascal Handle RecoverHandleSys(Ptr p)
  227.  ONEWORDINLINE(0xA528);
  228.  
  229. #if !GENERATINGCFM
  230. #pragma parameter __A0 NewPtr(__D0)
  231. #endif
  232. extern pascal Ptr NewPtr(Size byteCount)
  233.  ONEWORDINLINE(0xA11E);
  234.  
  235. #if !GENERATINGCFM
  236. #pragma parameter __A0 NewPtrSys(__D0)
  237. #endif
  238. extern pascal Ptr NewPtrSys(Size byteCount)
  239.  ONEWORDINLINE(0xA51E);
  240.  
  241. #if !GENERATINGCFM
  242. #pragma parameter __A0 NewPtrClear(__D0)
  243. #endif
  244. extern pascal Ptr NewPtrClear(Size byteCount)
  245.  ONEWORDINLINE(0xA31E);
  246.  
  247. #if !GENERATINGCFM
  248. #pragma parameter __A0 NewPtrSysClear(__D0)
  249. #endif
  250. extern pascal Ptr NewPtrSysClear(Size byteCount)
  251.  ONEWORDINLINE(0xA71E);
  252.  
  253. #if !GENERATINGCFM
  254. #pragma parameter __A0 PtrZone(__A0)
  255. #endif
  256. extern pascal THz PtrZone(Ptr p)
  257.  ONEWORDINLINE(0xA148);
  258.  
  259. #if !GENERATINGCFM
  260. #pragma parameter __D0 MaxBlock
  261. #endif
  262. extern pascal long MaxBlock(void)
  263.  ONEWORDINLINE(0xA061);
  264.  
  265. #if !GENERATINGCFM
  266. #pragma parameter __D0 MaxBlockSys
  267. #endif
  268. extern pascal long MaxBlockSys(void)
  269.  ONEWORDINLINE(0xA461);
  270.  
  271. #if !GENERATINGCFM
  272. #pragma parameter __D0 StackSpace
  273. #endif
  274. extern pascal long StackSpace(void)
  275.  ONEWORDINLINE(0xA065);
  276.  
  277. #if !GENERATINGCFM
  278. #pragma parameter __A0 NewEmptyHandle
  279. #endif
  280. extern pascal Handle NewEmptyHandle(void)
  281.  ONEWORDINLINE(0xA166);
  282.  
  283. #if !GENERATINGCFM
  284. #pragma parameter __A0 NewEmptyHandleSys
  285. #endif
  286. extern pascal Handle NewEmptyHandleSys(void)
  287.  ONEWORDINLINE(0xA566);
  288.  
  289. #if !GENERATINGCFM
  290. #pragma parameter HLock(__A0)
  291. #endif
  292. extern pascal void HLock(Handle h)
  293.  ONEWORDINLINE(0xA029);
  294.  
  295. #if !GENERATINGCFM
  296. #pragma parameter HUnlock(__A0)
  297. #endif
  298. extern pascal void HUnlock(Handle h)
  299.  ONEWORDINLINE(0xA02A);
  300.  
  301. #if !GENERATINGCFM
  302. #pragma parameter HPurge(__A0)
  303. #endif
  304. extern pascal void HPurge(Handle h)
  305.  ONEWORDINLINE(0xA049);
  306.  
  307. #if !GENERATINGCFM
  308. #pragma parameter HNoPurge(__A0)
  309. #endif
  310. extern pascal void HNoPurge(Handle h)
  311.  ONEWORDINLINE(0xA04A);
  312.  
  313. #if !GENERATINGCFM
  314. #pragma parameter HLockHi(__A0)
  315. #endif
  316. extern pascal void HLockHi(Handle h)
  317.  TWOWORDINLINE(0xA064, 0xA029);
  318. extern pascal Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
  319.  THREEWORDINLINE(0x3F3C, 0x001D, 0xA88F);
  320. extern pascal Size TempMaxMem(Size *grow)
  321.  THREEWORDINLINE(0x3F3C, 0x0015, 0xA88F);
  322. extern pascal long TempFreeMem(void)
  323.  THREEWORDINLINE(0x3F3C, 0x0018, 0xA88F);
  324. /*  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  */
  325. extern pascal void TempHLock(Handle h, OSErr *resultCode)
  326.  THREEWORDINLINE(0x3F3C, 0x001E, 0xA88F);
  327. extern pascal void TempHUnlock(Handle h, OSErr *resultCode)
  328.  THREEWORDINLINE(0x3F3C, 0x001F, 0xA88F);
  329. extern pascal void TempDisposeHandle(Handle h, OSErr *resultCode)
  330.  THREEWORDINLINE(0x3F3C, 0x0020, 0xA88F);
  331. extern pascal Ptr TempTopMem(void)
  332.  THREEWORDINLINE(0x3F3C, 0x0016, 0xA88F);
  333. extern pascal void InitApplZone(void)
  334.  ONEWORDINLINE(0xA02C);
  335. extern pascal void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr);
  336.  
  337. #if !GENERATINGCFM
  338. #pragma parameter SetZone(__A0)
  339. #endif
  340. extern pascal void SetZone(THz hz)
  341.  ONEWORDINLINE(0xA01B);
  342.  
  343. #if !GENERATINGCFM
  344. #pragma parameter __D0 CompactMem(__D0)
  345. #endif
  346. extern pascal Size CompactMem(Size cbNeeded)
  347.  ONEWORDINLINE(0xA04C);
  348.  
  349. #if !GENERATINGCFM
  350. #pragma parameter __D0 CompactMemSys(__D0)
  351. #endif
  352. extern pascal Size CompactMemSys(Size cbNeeded)
  353.  ONEWORDINLINE(0xA44C);
  354.  
  355. #if !GENERATINGCFM
  356. #pragma parameter PurgeMem(__D0)
  357. #endif
  358. extern pascal void PurgeMem(Size cbNeeded)
  359.  ONEWORDINLINE(0xA04D);
  360.  
  361. #if !GENERATINGCFM
  362. #pragma parameter PurgeMemSys(__D0)
  363. #endif
  364. extern pascal void PurgeMemSys(Size cbNeeded)
  365.  ONEWORDINLINE(0xA44D);
  366.  
  367. #if !GENERATINGCFM
  368. #pragma parameter __D0 FreeMem
  369. #endif
  370. extern pascal long FreeMem(void)
  371.  ONEWORDINLINE(0xA01C);
  372.  
  373. #if !GENERATINGCFM
  374. #pragma parameter __D0 FreeMemSys
  375. #endif
  376. extern pascal long FreeMemSys(void)
  377.  ONEWORDINLINE(0xA41C);
  378.  
  379. #if !GENERATINGCFM
  380. #pragma parameter ReserveMem(__D0)
  381. #endif
  382. extern pascal void ReserveMem(Size cbNeeded)
  383.  ONEWORDINLINE(0xA040);
  384.  
  385. #if !GENERATINGCFM
  386. #pragma parameter ReserveMemSys(__D0)
  387. #endif
  388. extern pascal void ReserveMemSys(Size cbNeeded)
  389.  ONEWORDINLINE(0xA440);
  390.  
  391. #if !GENERATINGCFM
  392. #pragma parameter __D0 MaxMem(__A1)
  393. #endif
  394. extern pascal Size MaxMem(Size *grow)
  395.  TWOWORDINLINE(0xA11D, 0x2288);
  396.  
  397. #if !GENERATINGCFM
  398. #pragma parameter __D0 MaxMemSys(__A1)
  399. #endif
  400. extern pascal Size MaxMemSys(Size *grow)
  401.  TWOWORDINLINE(0xA51D, 0x2288);
  402.  
  403. #if !GENERATINGCFM
  404. #pragma parameter SetGrowZone(__A0)
  405. #endif
  406. extern pascal void SetGrowZone(GrowZoneUPP growZone)
  407.  ONEWORDINLINE(0xA04B);
  408.  
  409. #if !GENERATINGCFM
  410. #pragma parameter SetApplLimit(__A0)
  411. #endif
  412. extern pascal void SetApplLimit(void *zoneLimit)
  413.  ONEWORDINLINE(0xA02D);
  414.  
  415. #if !GENERATINGCFM
  416. #pragma parameter MoveHHi(__A0)
  417. #endif
  418. extern pascal void MoveHHi(Handle h)
  419.  ONEWORDINLINE(0xA064);
  420.  
  421. #if !GENERATINGCFM
  422. #pragma parameter DisposePtr(__A0)
  423. #endif
  424. extern pascal void DisposePtr(Ptr p)
  425.  ONEWORDINLINE(0xA01F);
  426. extern pascal Size GetPtrSize(Ptr p);
  427.  
  428. #if !GENERATINGCFM
  429. #pragma parameter SetPtrSize(__A0, __D0)
  430. #endif
  431. extern pascal void SetPtrSize(Ptr p, Size newSize)
  432.  ONEWORDINLINE(0xA020);
  433.  
  434. #if !GENERATINGCFM
  435. #pragma parameter DisposeHandle(__A0)
  436. #endif
  437. extern pascal void DisposeHandle(Handle h)
  438.  ONEWORDINLINE(0xA023);
  439.  
  440. #if !GENERATINGCFM
  441. #pragma parameter SetHandleSize(__A0, __D0)
  442. #endif
  443. extern pascal void SetHandleSize(Handle h, Size newSize)
  444.  ONEWORDINLINE(0xA024);
  445. extern pascal Size GetHandleSize(Handle h);
  446.  
  447. #if !GENERATINGCFM
  448. #pragma parameter __D0 InlineGetHandleSize(__A0)
  449. #endif
  450. extern pascal Size InlineGetHandleSize(Handle h)
  451.  ONEWORDINLINE(0xA025);
  452.  
  453. #if !GENERATINGCFM
  454. #pragma parameter ReallocateHandle(__A0, __D0)
  455. #endif
  456. extern pascal void ReallocateHandle(Handle h, Size byteCount)
  457.  ONEWORDINLINE(0xA027);
  458.  
  459. #if !GENERATINGCFM
  460. #pragma parameter EmptyHandle(__A0)
  461. #endif
  462. extern pascal void EmptyHandle(Handle h)
  463.  ONEWORDINLINE(0xA02B);
  464.  
  465. #if !GENERATINGCFM
  466. #pragma parameter HSetRBit(__A0)
  467. #endif
  468. extern pascal void HSetRBit(Handle h)
  469.  ONEWORDINLINE(0xA067);
  470.  
  471. #if !GENERATINGCFM
  472. #pragma parameter HClrRBit(__A0)
  473. #endif
  474. extern pascal void HClrRBit(Handle h)
  475.  ONEWORDINLINE(0xA068);
  476. extern pascal void MoreMasters(void)
  477.  ONEWORDINLINE(0xA036);
  478.  
  479. #if !GENERATINGCFM
  480. #pragma parameter BlockMove(__A0, __A1, __D0)
  481. #endif
  482. extern pascal void BlockMove(const void *srcPtr, void *destPtr, Size byteCount)
  483.  ONEWORDINLINE(0xA02E);
  484.  
  485. #if !GENERATINGCFM
  486. #pragma parameter BlockMoveData(__A0, __A1, __D0)
  487. #endif
  488. extern pascal void BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount)
  489.  ONEWORDINLINE(0xA22E);
  490. extern pascal void PurgeSpace(long *total, long *contig);
  491.  
  492. #if !GENERATINGCFM
  493. #pragma parameter __D0 HGetState(__A0)
  494. #endif
  495. extern pascal SInt8 HGetState(Handle h)
  496.  ONEWORDINLINE(0xA069);
  497.  
  498. #if !GENERATINGCFM
  499. #pragma parameter HSetState(__A0, __D0)
  500. #endif
  501. extern pascal void HSetState(Handle h, SInt8 flags)
  502.  ONEWORDINLINE(0xA06A);
  503.  
  504. #if !GENERATINGCFM
  505. #pragma parameter SetApplBase(__A0)
  506. #endif
  507. extern pascal void SetApplBase(void *startPtr)
  508.  ONEWORDINLINE(0xA057);
  509. extern pascal void MaxApplZone(void)
  510.  ONEWORDINLINE(0xA063);
  511.  
  512. #if !GENERATINGCFM
  513. #pragma parameter __D0 HoldMemory(__A0, __A1)
  514. #endif
  515. extern pascal OSErr HoldMemory(void *address, unsigned long count)
  516.  TWOWORDINLINE(0x7000, 0xA05C);
  517.  
  518. #if !GENERATINGCFM
  519. #pragma parameter __D0 UnholdMemory(__A0, __A1)
  520. #endif
  521. extern pascal OSErr UnholdMemory(void *address, unsigned long count)
  522.  TWOWORDINLINE(0x7001, 0xA05C);
  523.  
  524. #if !GENERATINGCFM
  525. #pragma parameter __D0 LockMemory(__A0, __A1)
  526. #endif
  527. extern pascal OSErr LockMemory(void *address, unsigned long count)
  528.  TWOWORDINLINE(0x7002, 0xA05C);
  529.  
  530. #if !GENERATINGCFM
  531. #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
  532. #endif
  533. extern pascal OSErr LockMemoryContiguous(void *address, unsigned long count)
  534.  TWOWORDINLINE(0x7004, 0xA05C);
  535.  
  536. #if !GENERATINGCFM
  537. #pragma parameter __D0 UnlockMemory(__A0, __A1)
  538. #endif
  539. extern pascal OSErr UnlockMemory(void *address, unsigned long count)
  540.  TWOWORDINLINE(0x7003, 0xA05C);
  541. extern pascal OSErr GetPhysical(LogicalToPhysicalTable *addresses, unsigned long *physicalEntryCount);
  542.  
  543. #if !GENERATINGCFM
  544. #pragma parameter __D0 DeferUserFn(__A0, __D0)
  545. #endif
  546. extern pascal OSErr DeferUserFn(UserFnUPP userFunction, void *argument)
  547.  ONEWORDINLINE(0xA08F);
  548.  
  549. #if !GENERATINGCFM
  550. #pragma parameter __D0 DebuggerGetMax
  551. #endif
  552. extern pascal long DebuggerGetMax(void)
  553.  TWOWORDINLINE(0x7000, 0xA08D);
  554. extern pascal void DebuggerEnter(void)
  555.  TWOWORDINLINE(0x7001, 0xA08D);
  556. extern pascal void DebuggerExit(void)
  557.  TWOWORDINLINE(0x7002, 0xA08D);
  558. extern pascal void DebuggerPoll(void)
  559.  TWOWORDINLINE(0x7003, 0xA08D);
  560.  
  561. #if !GENERATINGCFM
  562. #pragma parameter __D0 GetPageState(__A0)
  563. #endif
  564. extern pascal PageState GetPageState(const void *address)
  565.  TWOWORDINLINE(0x7004, 0xA08D);
  566.  
  567. #if !GENERATINGCFM
  568. #pragma parameter __D0 PageFaultFatal
  569. #endif
  570. extern pascal Boolean PageFaultFatal(void)
  571.  TWOWORDINLINE(0x7005, 0xA08D);
  572.  
  573. #if !GENERATINGCFM
  574. #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
  575. #endif
  576. extern pascal OSErr DebuggerLockMemory(void *address, unsigned long count)
  577.  TWOWORDINLINE(0x7006, 0xA08D);
  578.  
  579. #if !GENERATINGCFM
  580. #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
  581. #endif
  582. extern pascal OSErr DebuggerUnlockMemory(void *address, unsigned long count)
  583.  TWOWORDINLINE(0x7007, 0xA08D);
  584.  
  585. #if !GENERATINGCFM
  586. #pragma parameter __D0 EnterSupervisorMode
  587. #endif
  588. extern pascal StatusRegisterContents EnterSupervisorMode(void)
  589.  TWOWORDINLINE(0x7008, 0xA08D);
  590. /* StripAddress and Translate24To32 macro to nothing on PowerPC
  591.    StripAddress is implemented as a trap in System 6 or later */
  592. #if !GENERATINGPOWERPC
  593. #if SystemSixOrLater
  594.  
  595. #if !GENERATINGCFM
  596. #pragma parameter __D0 StripAddress(__D0)
  597. #endif
  598. extern pascal Ptr StripAddress(void *theAddress)
  599.  ONEWORDINLINE(0xA055);
  600. #else
  601. extern pascal Ptr StripAddress(void *theAddress);
  602. #endif
  603. #else
  604. #define StripAddress(x) ((Ptr)(x))
  605. #endif
  606. #if !GENERATINGPOWERPC
  607.  
  608. #if !GENERATINGCFM
  609. #pragma parameter __D0 Translate24To32(__D0)
  610. #endif
  611. extern pascal Ptr Translate24To32(void *addr24)
  612.  ONEWORDINLINE(0xA091);
  613. #else
  614. #define Translate24To32(x) ((Ptr)(x))
  615. #endif
  616. extern pascal OSErr HandToHand(Handle *theHndl);
  617.  
  618. #if !GENERATINGCFM
  619. #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
  620. #endif
  621. extern pascal OSErr PtrToXHand(const void *srcPtr, Handle dstHndl, long size)
  622.  ONEWORDINLINE(0xA9E2);
  623. extern pascal OSErr PtrToHand(const void *srcPtr, Handle *dstHndl, long size);
  624.  
  625. #if !GENERATINGCFM
  626. #pragma parameter __D0 HandAndHand(__A0, __A1)
  627. #endif
  628. extern pascal OSErr HandAndHand(Handle hand1, Handle hand2)
  629.  ONEWORDINLINE(0xA9E4);
  630.  
  631. #if !GENERATINGCFM
  632. #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
  633. #endif
  634. extern pascal OSErr PtrAndHand(const void *ptr1, Handle hand2, long size)
  635.  ONEWORDINLINE(0xA9EF);
  636. #if OLDROUTINENAMES
  637. #define ApplicZone() ApplicationZone()
  638. #define MFTempNewHandle(logicalSize, resultCode) TempNewHandle(logicalSize, resultCode)
  639. #define MFMaxMem(grow) TempMaxMem(grow)
  640. #define MFFreeMem() TempFreeMem()
  641. #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
  642. #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
  643. #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
  644. #define MFTopMem() TempTopMem()
  645. #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
  646. #define DisposPtr(p) DisposePtr(p)
  647. #define DisposHandle(h) DisposeHandle(h)
  648. #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
  649. #endif
  650.  
  651. #if PRAGMA_IMPORT_SUPPORTED
  652. #pragma import off
  653. #endif
  654.  
  655. #if PRAGMA_ALIGN_SUPPORTED
  656. #pragma options align=reset
  657. #endif
  658.  
  659. #ifdef __cplusplus
  660. }
  661. #endif
  662.  
  663. #endif /* __MEMORY__ */
  664.